package response

// CpuUsageTop10Response cpu使用率top10
type CpuUsageTop10Response struct {
	Series TimeSeriesResponse `json:"-"`
}

// MemoryUsageTop10Response 内存使用率top10
type MemoryUsageTop10Response struct {
	Series TimeSeriesResponse `json:"-"`
}

// NodeAnalysisResponse node节点分析
type NodeAnalysisResponse struct {
	IDCName       string `json:"idcName"`
	TotalNodes    int    `json:"totalNodes"`
	AbnormalNodes int    `json:"abnormalNodes"`
}

// PartitionTop5Response 分区使用率top5
type PartitionTop5Response struct {
	Partition       string  `json:"partition"`
	UsagePercentage float64 `json:"usagePercentage"`
	TotalSizeBytes  int64   `json:"totalSizeBytes"`
	UsedSizeBytes   int64   `json:"usedSizeBytes"`
	FreeSizeBytes   int64   `json:"freeSizeBytes"`
}

// WorkloadResponse 负载数量统计
type WorkloadResponse struct {
	IDCName      string       `json:"idcName"`
	Deployments  WorkloadInfo `json:"deployments"`
	DaemonSets   WorkloadInfo `json:"daemonSets"`
	StatefulSets WorkloadInfo `json:"statefulSets"`
}

type WorkloadInfo struct {
	Total    int `json:"total"`
	Abnormal int `json:"abnormal"`
}

// ResourceAllocationResponse 资源分配率
type ResourceAllocationResponse struct {
	IDCName              string  `json:"idcName"`
	CpuAllocationRate    float64 `json:"cpuAllocationRate"`
	MemoryAllocationRate float64 `json:"memoryAllocationRate"`
}

// NetTrafficTrendResponse 网络流入流出趋势
type NetTrafficTrendResponse struct {
	Series TimeSeriesResponse `json:"-"`
}

// K8sMasterAnalysisResponse master节点分析
type K8sMasterAnalysisResponse struct {
	Series         TimeSeriesResponse `json:"-"`
	WorkQueueDelay WorkQueueDelay     `json:"workQueueDelay"`
	APIServerCalls APIServerCalls     `json:"apiServerCalls"`
	EtcdNodes      EtcdNodes          `json:"etcdNodes"`
}

type WorkQueueDelay struct {
	DelayMs            float64 `json:"delayMs"`
	YearOverYearRate   float64 `json:"yearOverYearRate"`
	MonthOverMonthRate float64 `json:"monthOverMonthRate"`
}

type APIServerCalls struct {
	TotalCalls       int64 `json:"totalCalls"`
	TotalCallDelayMs int64 `json:"totalCallDelayMs"`
}

type EtcdNodes struct {
	TotalNodes    int `json:"totalNodes"`
	AbnormalNodes int `json:"abnormalNodes"`
}
